#ifndef GTD_VIDEO_HPP
#define GTD_VIDEO_HPP
#include "gtd_common.hpp"

NAMESPACE_BEG(gtd)

class VideoSource
{
public:
    VideoSource();
    virtual ~VideoSource();

    virtual const uchar4* getFrame() = 0;
    int getWidth() const;
    int getHeight() const;

protected:
    int width;
    int height;
};

class AviFile: public VideoSource
{
public:
    AviFile(const std::string& filename);
    ~AviFile();

    const uchar4* getFrame();

private:
    struct Data;
    Data* data;

    uchar4* d_frame;
};

class GenVideo: public VideoSource
{
public:
    GenVideo();
    ~GenVideo();

    const uchar4* getFrame();

private:
    uchar4* d_frame;
    std::vector<uchar4> frame;
    cudaGraphicsResource* resource;
    GLuint rt;
};

NAMESPACE_END(gtd)

#endif
